home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Magazine / C_Tutorial / Part-1 / basics2.c < prev    next >
C/C++ Source or Header  |  1997-06-05  |  1KB  |  47 lines

  1. #include<exec/libraries.h>
  2. #include<intuition/intuition.h>
  3. #include<utility/tagitem.h>
  4. #include<graphics/text.h>
  5.  
  6. #include<string.h>
  7.  
  8. #include<clib/exec_protos.h>
  9. #include<clib/graphics_protos.h>
  10. #include<clib/intuition_protos.h>
  11.  
  12. struct Library* GfxBase;
  13. struct Library* IntuitionBase;
  14.  
  15. void main()
  16. {
  17.     GfxBase = OpenLibrary("graphics.library",36);
  18.     if(GfxBase != NULL)
  19.     {
  20.         IntuitionBase = OpenLibrary("intuition.library",36);
  21.         if(IntuitionBase != NULL)
  22.         {
  23.             struct Window* win;
  24.             win = OpenWindowTags(NULL,
  25.                                                         WA_Left,        20,
  26.                                                         WA_Top,            20,
  27.                                                         WA_Width,        200,
  28.                                                         WA_Height,    100,
  29.                                                         WA_Flags,        WFLG_CLOSEGADGET,
  30.                                                         WA_IDCMP,        IDCMP_CLOSEWINDOW,
  31.                                                         TAG_DONE,        0);
  32.             if(win != NULL)
  33.             {
  34.                 char* text;
  35.                 text = "Hello World!";
  36.                 SetAPen(win->RPort, 1);
  37.                 Move(win->RPort, 10, 60);
  38.                 Text(win->RPort, text, strlen(text));
  39.                 WaitPort(win->UserPort);
  40.                 CloseWindow(win);
  41.             }
  42.             CloseLibrary(IntuitionBase);
  43.         }
  44.         CloseLibrary(GfxBase);
  45.     }
  46. }
  47.